package main

import (
	"fmt"
	"go/dao"
	"go/pkg/gredis"
	"go/pkg/setting"
	"go/routers"
	"net/http"

	"github.com/gin-gonic/gin"
)

func init() {
	setting.Setup()
	dao.Setup()
	gredis.Setup()
}

func main() {
	//for i:=1; i < 10000; i++{
	//	services.AddStaff(models.Staff{1,"testtest" + strconv.Itoa(i),"wwy123456",1,"2312312",132133,"测试用户",false,time.Now()})
	//}
	endPoint := fmt.Sprintf(":%d", setting.ServerSetting.HttpPort)
	routersInit := routers.InitRouter()

	routersInit.GET("/", func(c *gin.Context) {
		c.JSON(http.StatusOK, gin.H{
			"ping": "pong",
		})
	})
	routersInit.Run(endPoint)
}
